package edu.luc.cs413s13.team1.monsterm.controller;

import android.view.View;

/** Redraws the UI every 50ms until done (end of program) */
class UIUpdateThread implements Runnable {

    private volatile boolean done;
    private View view;
    
    UIUpdateThread(View view) {
    	this.view = view;
    }

    public void done() { done = true; }

    @Override
    public void run() {
        while (!done) {
        	try {
				Thread.sleep(50);
			} catch (InterruptedException e1) {
				e1.printStackTrace();
			}
        	view.postInvalidate();
        }
    }
}
